<?php $personalResult = $records;?>
<?php if(isset($personalResult)): ?>
<div class="container">
    <div id="content">
      <h2 class="title">PA Score Detail for <?php echo $personalResult->getEmpName(); ?></h2>
      	  <br>
          <ul>
            <li>
              <p>Performance Appraisal (PA) result for <strong><?php echo "December 2012";//date('M Y',strtotime($personalResult->getCreatedDate())); ?></strong> with detail below</p>
              <label>Current level / position: <strong class="position"><?php echo $personalResult->getCurrentLevel(); ?></strong></label><br/>
 <label>New level / position: <strong class="position"><?php echo $personalResult->getNewLevel(); ?></strong></label><br/>
              <label>New expected level / position: <strong class="position"><?php echo $personalResult->getExpectLevel(); ?></strong></label>
            </li>
          </ul>
      <div class="PAResultTable">
        <p><em>(The score is from <strong>1 to 5</strong>; <strong>1</strong> is lowest, <strong>5</strong> is the highest)</em></p>
        <table class="dataTable" cellpadding="0" cellspacing="0" border="0">
        <?php if($personalResult->getPAType()=='ENGINEER'): ?>
          <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>English</th>
            <th rowspan="2">Final Rating</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>20</th>
            <th>13</th>
            <th>13</th>
            <th>10</th>
            <th>15</th>
            <th>16</th>
            <th>13</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php elseif($personalResult->getPAType()=='LEADER'): ?>
       <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>Corporate Development</th>
            <th>English</th>
            <th rowspan="2">Total</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>16</th>
            <th>13</th>
            <th>11</th>
            <th>10</th>
            <th>15</th>
            <th>13</th>
            <th>11</th>
            <th>11</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getCorporateDevelopment(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php elseif($personalResult->getPAType()=='MANAGER'): ?>
       <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>Corporate Development</th>
            <th>English</th>
            <th rowspan="2">Total</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>14</th>
            <th>10</th>
            <th>13</th>
            <th>11</th>
            <th>15</th>
            <th>13</th>
            <th>14</th>
            <th>10</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getCorporateDevelopment(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php elseif($personalResult->getPAType()=='DIRECTOR'): ?>
       <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>Corporate Development</th>
            <th>English</th>
            <th rowspan="2">Total</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>14</th>
            <th>12</th>
            <th>10</th>
            <th>11</th>
            <th>15</th>
            <th>13</th>
            <th>16</th>
            <th>9</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getCorporateDevelopment(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php elseif($personalResult->getPAType()=='STAFF'): ?>
       <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>English</th>
            <th rowspan="2">Total</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>17</th>
            <th>14</th>
            <th>16</th>
            <th>12</th>
            <th>15</th>
            <th>13</th>
            <th>13</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php else: ?>
       <colgroup>
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
            <col width="" />
          </colgroup>
          <tr>
            <th>Criteria</th>
            <th>Performance on Job</th>
            <th>Technical/Job <br/> Knowledge</th>
            <th>Teamwork/Team <br /> Orientation</th>
            <th>Management</th>
            <th>Disciplined</th>
            <th>Communication</th>
            <th>English</th>
            <th rowspan="2">Total</th>
          </tr>
          <tr>
            <th>Ratio</th>
            <th>17</th>
            <th>14</th>
            <th>16</th>
            <th>13</th>
            <th>15</th>
            <th>13</th>
            <th>12</th>
          </tr>
          <tr>
            <td><strong>PA Score</strong></td>
            <td><?php echo $personalResult->getPerformanceOnJob(); ?></td>
            <td><?php echo $personalResult->getJobKnowledge(); ?></td>
            <td><?php echo $personalResult->getTeamWork(); ?></td>
            <td><?php echo $personalResult->getManagement(); ?></td>
            <td><?php echo $personalResult->getDisciplined(); ?></td>
            <td><?php echo $personalResult->getCommunication(); ?></td>
            <td><?php echo $personalResult->getPAEngLish(); ?></td>
            <td><?php echo $personalResult->getPAScore(); ?></td>
          </tr>
        </table>
      </div>
      <?php endif; ?>
      <div class="notice">
        <p>As the result of your PA, your new salary starting from <?php echo "July 2012";//date('M Y',strtotime($personalResult->getCreatedDate())); ?> will be below.</p>
        <ul class="listNotes">
          <li>Current salary
          	<ul>
            	<li>Net: <strong><?php echo number_format((double)$personalResult->getCurrentNetSalary()); ?> VND</strong></li>
              <li>Gross: <strong><?php echo number_format((double)$personalResult->getCurrentGrossSalary()); ?> VND</strong>
              		 <ul>
                	<li>Current salary for labor contract: <strong><?php echo number_format((double)$personalResult->getCurrentContractSalary()); ?> VND</strong></li>
                </ul>
              </li>
            </ul>
          </li>

          <li class="newSalary">
          	New salary
            <ul>
            	<li>
              	Net: <strong><?php echo number_format((double)$personalResult->getNewNetSalary()); ?> VND (= <?php echo number_format((double)$personalResult->getCurrentNetSalary()); ?> VND + <?php echo number_format((double)$personalResult->getPAAdjust()); ?> VND + <?php echo number_format((double)$personalResult->getPALevelAdjust()); ?> VND)</strong>
                <ul>
                	<li>Amount is based on PA result: <strong><?php echo number_format((double)$personalResult->getPAAdjust()); ?> VND</strong> (<?php if($personalResult->getPAAdjust()): ?><?php echo (number_format((double)($personalResult->getPAAdjust()/$personalResult->getCurrentNetSalary())*100)) ?>%)<?php else: ?>0%)<?php endif; ?></li>
	            	<li>Adjust to map with level: <strong><?php echo number_format((double)$personalResult->getPALevelAdjust()); ?> VND</strong> </li>
                </ul>
              </li>
              <li>
              	Gross: <strong><?php echo number_format((double)$personalResult->getNewGrossSalary()); ?> VND</strong>
                <ul>
                	<li>New salary for labor contract: <strong><?php echo number_format((double)$personalResult->getNewContractSalary()); ?> VND</strong></li>
                </ul>
              </li>
            </ul>
           </li>
        </ul>
      </div>
    </div>
  </div>
  <?php endif; ?>
